package AsLayers.Tile
{

	
	import AsLayers.BaseType.Bounds;
	import AsLayers.BaseType.Pixel;
	import AsLayers.BaseType.Size;
	import AsLayers.Layer.ILayer;
    import mx.controls.Image;
	public class Image extends Base
	{

		public var display:mx.controls.Image=new mx.controls.Image();
		public function Image(position:Pixel, bounds:Bounds, size:Size)
		{
			super(position, bounds, size);
			//this.display.x=this.position.x;
			//this.display.y=this.position.y;
		}
		
		override public function setLayer(layer:ILayer):void{
			super.setLayer(layer);
		    
			
		}
		override public function destroy():void{
			super.destroy();
			this.display.parent.removeChild(this.display)
			this.display=null;
		}
		override public  function draw():void{
		   // trace(this.layer.getUrl(this.bounds))
		   this.display.x=this.position.x;
		   this.display.y=this.position.y;
		
		   this.display.move(this.position.x,this.position.y);
		   
           this.display.source=this.layer.getUrl(this.bounds);
	    }
	}
}